perf: defer API run creation until first emission upload (3/4)#1253
Merged
Conversation
This was referenced Jun 21, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1253 +/- ##
=======================================
Coverage 89.61% 89.62%
=======================================
Files 48 48
Lines 4757 4761 +4
=======================================
+ Hits 4263 4267 +4
Misses 494 494 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
1f759d9 to
9d1c656
Compare
a85be35 to
07b82eb
Compare
9d1c656 to
00817d8
Compare
07b82eb to
928621d
Compare
Add process-level hardware setup cache, probe result caching, platform-aware CPU backend selection, and parallel CPU/GPU setup for faster repeat runs. Co-authored-by: Cursor <cursoragent@cursor.com>
Import GPU/CPU probe modules before clearing caches so lru_cache state does not leak across tests in the full suite. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
Author
928621d to
85a0b1f
Compare
00817d8 to
31dc256
Compare
Cover scalar GPU id normalization, defensive error paths, power gadget setup, and fallback tracking branches missing from the PR patch report. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip POST /runs during tracker startup and create the run lazily on the first live_out/out call when an experiment id is configured. Co-authored-by: Cursor <cursoragent@cursor.com>
85a0b1f to
e8e07e9
Compare
Base automatically changed from
davidberenstein1957/perf-2-hardware-cache
to
master
June 29, 2026 12:10
inimaz
approved these changes
Jun 29, 2026
inimaz
left a comment
Collaborator
There was a problem hiding this comment.
Nice, this will make it much faster the first setup of the client. Thanks @davidberenstein1957 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 3/4 of the tracker performance stack. Depends on #1251 → #1252.
cc @inimaz — small, isolated API write-path change from the #1246 split.
Defers the
POST /runsAPI call until the first emission is actually uploaded, so online trackers with API output enabled no longer block on run creation during startup:CodeCarbonAPIOutputusescreate_run_automatically=False_ensure_api_run()creates the run lazily on firstlive_out/outcallBenchmarks (measured locally, offline Mac ARM, 2026-06-21)
Mocked geo/cloud/API network; measures
EmissionsTracker(save_to_api=True)coldstart():start()avgPOST /runsat startup__init__/ warm lifecycleStack
CI / quality
pre-commit runon all changed files — passedpytest tests/output_methods/test_http.py— 9 passedTest plan
Replaces
Split from #1246.